import axios from 'axios'
import router from '../../src/router'

// 自己创建一个axios的实例
let instance = axios.create({})

instance.interceptors.request.use(
    config => {
        var token = sessionStorage.getItem('token')
        if (! token){
            router.push({'name': 'Login'})
        }
        return config
    }
)
export default instance
